package com.yunmang.http;

import com.yunmang.entity.BatchDetailBean;
import com.yunmang.entity.CarListBean;
import com.yunmang.entity.ConfigBean;
import com.yunmang.entity.DeliverBean;
import com.yunmang.entity.ExceptionQueryBean;
import com.yunmang.entity.FahuoStatictics;
import com.yunmang.entity.LoginBean;
import com.yunmang.entity.MemberBean;
import com.yunmang.entity.NameBean;
import com.yunmang.entity.OpenTicketResultBean;
import com.yunmang.entity.OrderDetailBean;
import com.yunmang.entity.PackageBean;
import com.yunmang.entity.ParameterEntity.ConfirmBean;
import com.yunmang.entity.ParameterEntity.NextStationBean;
import com.yunmang.entity.ParameterEntity.OrderLookBean;
import com.yunmang.entity.ParameterEntity.PsSuccessBean;
import com.yunmang.entity.ParameterEntity.SignBean;
import com.yunmang.entity.ParameterEntity.UploadSignBean;
import com.yunmang.entity.SavingStatictics;
import com.yunmang.entity.SendBatchBean;
import com.yunmang.entity.SignStatictics;
import com.yunmang.entity.TraceBean;
import com.yunmang.entity.TransportBean;
import com.yunmang.entity.UpdateVersionBean;

import java.util.Map;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * 与服务对接的接口类
 * Created by ltt on 2017/3/21.
 */
public interface InterfaceService {
    @FormUrlEncoded
    @POST("account/logon")
//登录
    Observable<LoginBean> login(@FieldMap Map<String, String> params);

    @FormUrlEncoded
    @POST("account/change-password")
    //修改密码
    Observable<NameBean> changePwd(@FieldMap Map<String, String> params);

    @GET("common/car")
//获取车辆列表
    Observable<CarListBean> getCarList();

    @GET("common/option")
//获取包装和结算方式
    Observable<PackageBean> getPackages();

    @GET("common/cfg-option")
//获取配置参数
    Observable<ConfigBean> getConfigParams();

    @GET("common/member")
//获取会员号
    Observable<MemberBean> getMemberInfo(@Query("code") String code);

    @GET("common/consignee")
//获取收货人姓名
    Observable<NameBean> getConsignee(@Query("phone") String phone);

    @GET("common/shipper")
//获取发货人姓名
    Observable<NameBean> getshipper(@Query("phone") String phone);

    @POST("billnew/create")
//上传开票信息
    Observable<OpenTicketResultBean> save(@Body RequestBody inJson);

    @GET("billsend/query")
    Observable<TransportBean> getTransportInfo(@Query("hdbh") String hdbh,@Query("nextId") String nextId,@Query("userId") String userId);


    @GET("common/next-org")
    Observable<NextStationBean> getNextStation(@Query("orgId") String orgId);
    //发车
    @POST("billsend/create")
    Observable<NameBean> billSend(@Body RequestBody inJson);

    @GET("billsearch/query")
    //订单查询
    Observable<OrderLookBean> orderLook(@Query("StartDate") String StartDate,@Query("EndDate") String EndDate,@Query("Userid") String Userid,@Query("Hdbh") String Hdbh);

    @POST("common/invalid")
    Observable<NameBean> orderInvalid(@Body RequestBody inJson);

    @GET("billconfirm/query-bill")
    Observable<ConfirmBean> billconfirm(@Query("userId") String userId,@Query("hdbh") String hdbh);

    @POST("billconfirm/confirm-bill")
    Observable<NameBean> uploadConfirm(@Body RequestBody inJson);

    @GET("billsign/query")
    Observable<SignBean> downloadSignInfo(@Query("TakeMethod") String takeMethod, @Query("hdbh") String hdbh, @Query("OrgId") String OrgId);

    @POST("billsign/okone")
    Observable<UploadSignBean> uploadSign(@Body RequestBody inJson);

    @POST("billsign/deliverymanyok")
    Observable<PsSuccessBean> paisongAlert(@Body RequestBody inJson);

    @GET("common/deliverer")
    Observable<DeliverBean> getDeliverPerson(@Query("orgId") String orgId);

    @GET("common/bill")
    Observable<OrderDetailBean> getOrderDetial(@Query("hdbh") String hdbh,@Query("orgId") String orgId);

    @GET("common/bill-track")
    Observable<TraceBean>  getTraceInfo(@Query("hdbh") String hdbh);
    @GET("billsummary/billingquery")
    Observable<FahuoStatictics>  getFahuoStatictics(@Query("userId") String userId, @Query("StartDate") String StartDate
            , @Query("EndDate") String EndDate, @Query("StartDepartId") int StartDepartId, @Query("EndDepartId") int EndDepartId);
    @GET("billsummary/instockquery")
    Observable<SavingStatictics> getSavingStatictics(@Query("userId") String userId,
                                                     @Query("departId") int departId,@Query("inStockType") int inStockType);
    @GET("billsummary/signedquery")
    Observable<SignStatictics> getSignStatictics(@Query("userId") String userId, @Query("StartDate") String StartDate
            , @Query("EndDate") String EndDate, @Query("StartDepartId") int StartDepartId, @Query("EndDepartId") int EndDepartId);

    @POST("billexception/new")
    Observable<NameBean> addExcepion(@Body RequestBody inJson);

    @GET("billexception/query")
    Observable<ExceptionQueryBean> getExcptionByStatus(@Query("userId") String userId, @Query("StartDate") String StartDate
            , @Query("EndDate") String EndDate, @Query("Hdbh") String Hdbh,@Query("Status") String DateType);

    @POST("billexception/handle")
    Observable<NameBean> handleException(@Body RequestBody inJson);

    @GET("send-batch/search")
    Observable<SendBatchBean> getSendBatch(@Query("userId") String userId, @Query("startDate") String startDate
            , @Query("endDate") String endDate, @Query("hdbh") String hdbh, @Query("sendBatchStatus") String sendBatchStatus);

    @GET("send-batch/detail")
    Observable<BatchDetailBean> getBatchDetailById(@Query("userId") String userId,@Query("id") int id);

    @POST("send-batch/edit")
    Observable<NameBean> editBatch(@Body RequestBody inJson);


    @POST("common/bill-edit")
    Observable<NameBean> editbill(@Body RequestBody inJson);

    @GET("check/version")
    Observable<UpdateVersionBean> checkVersion();



}
